﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using myTunes.BO;

namespace myTunes.Commands
{
    public class PlaylistViewModelSetRepeatOnOffCommand
    {
        PlaylistViewModel _playlistViewModel;
        public PlaylistViewModelSetRepeatOnOffCommand(PlaylistViewModel playlistViewModel)
        {
            _playlistViewModel = playlistViewModel;
        }

        #region ICommand Members

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            _playlistViewModel.IsRepeat = !_playlistViewModel.IsRepeat;
        }

        #endregion
    }
}
